<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%-- <%@include file="../../common/taglib/taglib.jsp"%> --%>
<form id="pagerForm" method="post" action="${baseURL }/agent/profit/list">
	<%@include file="../common/pageParameter.jsp"%>
</form>
<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return navTabSearch(this);" action="${baseURL }/agent/profit/list" method="post">
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td>
						订单编号：
						<input type="text" name="merchantOrderNo" alt="请输入订单编号" value="${param.merchantOrderNo}" />
					</td>
					<td>
						商家名称：
						<input type="text" name="merchantName" alt="请输入商家名称" value="${param.merchantName}" />
					</td>
					<td>
						商品名称：
						<input type="text" name="productName" alt="请输入商品名称" value="${param.productName}" />
					</td>
					<td>
						分润类型：
						<select name="profitType">
							<option value="">请选择</option>
							<c:forEach items="${profitTypes}" var="type">
								<option value="${type.name }" <c:if test="${type.name eq param.profitType}">selected=selected</c:if>>${type.desc }</option>
							</c:forEach>

						</select>
					</td>
					<td>
						<div class="buttonActive">
							<div class="buttonContent">
								<button title="查询" type="submit">查&nbsp;询</button>
							</div>
						</div>
					</td>
				</tr>
			</table>
		</div>
	</form>
</div>
<div class="pageContent">
	<!-- <div class="panelBar">
		<ul class="toolBar">
		</ul>
	</div> -->
	<table class="table" width="101%" layoutH="87">
		<thead>
			<tr>
				<th>序号</th>
				<th>订单编号</th>
				<th>订单金额</th>
				<th>商家名称</th>
				<th>商品名称</th>
				<th>支付方式</th>
				<th>支付类型</th>
				<th>自营机构分润</th>
				<th>支付时间</th>
				<th>分润类型</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach var="bean" items="${pageBean.recordList}" varStatus="s">
				<tr>
					<td>${s.index + 1}</td>
					<td>${bean.merchantOrderNo}</td>
					<td>${bean.orderAmount}</td>
					<td>${bean.merchantName}</td>
					<td>${bean.productName}</td>
					<td>${bean.payWayName}</td>
					<td>${bean.payTypeName}</td>
					<td>
						<c:if test="${agent.level == 1 }">
					         ${bean.firstAgentName}分润：<fmt:parseNumber type="number" pattern="#,#00.0#">${bean.firstAgentProfit}</fmt:parseNumber>
							<br />
							<c:if test="${bean.secondAgentName !=null && bean.secondAgentName !='' }">
								<span style="line-height: 21px; padding-left: 20px;">|--&nbsp;&nbsp;${bean.secondAgentName}分润：<fmt:parseNumber type="number" pattern="#,#00.0#">${bean.secondAgentProfit}</fmt:parseNumber><br /></span>
							</c:if>
							<c:if test="${bean.thirdAgentName !=null && bean.thirdAgentName !='' }">
								<span style="line-height: 21px; padding-left: 50px;">|--&nbsp;&nbsp;${bean.thirdAgentName}分润：<fmt:parseNumber type="number" pattern="#,#00.0#">${bean.thirdAgentProfit}</fmt:parseNumber></span>
							</c:if>
						</c:if>
						<c:if test="${agent.level == 2 }">
					          ${bean.secondAgentName}分润：${bean.secondAgentProfit}<br />
							<c:if test="${bean.thirdAgentName !=null && bean.thirdAgentName !='' }">
								<span style="line-height: 21px; padding-left: 50px;">|--&nbsp;&nbsp;${bean.thirdAgentName}分润：<fmt:parseNumber type="number" pattern="#,#00.0#">${bean.thirdAgentProfit}</fmt:parseNumber></span>
							</c:if>
						</c:if>
						<c:if test="${agent.level == 3 }">
					          ${bean.thirdAgentName}分润：<fmt:parseNumber type="number" pattern="#,#00.0#">${bean.thirdAgentProfit}</fmt:parseNumber>
					    </c:if>
					</td>
					<td>
						<fmt:formatDate value="${bean.paySuccessTime}" pattern="yyyy-MM-dd HH:mm:ss" />
					</td>
					<td>
						<c:forEach items="${profitTypes}" var="profitType">
							<c:if test="${profitType.name eq bean.profitType}">${profitType.desc}</c:if>

						</c:forEach>
					</td>
				</tr>
			</c:forEach>
			<c:if test="${pageBean.totalCount==0}">
				<tr>
					<td>暂无数据</td>
				</tr>
			</c:if>
		</tbody>
	</table>
	<%@include file="../common/pageBar.jsp"%>
</div>
